import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/home',
  },
  {
    path: '/home',
    component: HomeView
  },
  {
    path: '/product/detail',
    component: () => import( '../views/product/detail')
  },
  {
    path: '/category',
    component: () => import( '../views/product/category')
  },
  {
    path: '/cart',
    component: () => import( '../views/user/cart')
  },
  {
    path: '/user',
    component: () => import( '../views/user/user')
  },
  {
    path: '/message',
    component: () => import( '../views/user/message')
  },
  {
    path: '/order/list',
    component: () => import( '../views/order/list')
  },


]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
